<#include "/includes/son.ftl">




<div class="container-fluid" style="margin-top: 15px;">
                <div class="row">
                    <div class="col-lg-12">
                            <div class="card">
                                <div class="card-body">

                                    <div class="toolbar-btn-action">
                                        <a class="btn btn-primary m-r-5" href="#!" id="addBtn"><i class="mdi mdi-plus"></i> 新增</a>
                                    </div>

                <div class="table-responsive">
                    <table class="table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>分类名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list iPage.records as ip>
                            <tr>
                                <td>${ip.id}</td>
                                <td>${ip.typeName}</td>
                                <td>
                                    <div class="btn-group">
                                        <a id="${ip.id}" class="btn btn-xs btn-default editBtn" href="#!" title="" data-toggle="tooltip" data-original-title="编辑"><i class="mdi mdi-pencil"></i></a>
                                        <a id="${ip.id}" class="btn btn-xs btn-default delBtn" href="#!" title="" data-toggle="tooltip" data-original-title="删除"><i class="mdi mdi-window-close"></i></a>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                    </tbody>
                </table>
             <ul id="pagination1" class="pagination"></ul>
            </div>
        </div>
    </div>
</div>
</div>
</div>

<script>
    var pageTotal='<#if iPage.total??>${iPage.total}</#if>'==''?1:${iPage.total};
    var pageSize='<#if iPage.size??>${iPage.size}</#if>'==''?10:${iPage.size};
    var currentPage='<#if iPage.current??>${iPage.current}</#if>'==''?1:${iPage.current};
    showPage(pageTotal,pageSize,currentPage);
</script>

<script>
    $(function () {
        $('#addBtn').click(function () {
            window.location.href = '/goods/shopGoodsType/goodsTypeEdit';
        });
        $('.editBtn').click(function () {
            window.location.href = '/goods/shopGoodsType/goodsTypeEdit?id=' + $(this).attr('id');
        });

        $(".delBtn").click(function () {
            $.post("/goods/shopGoodsType/goodsTypeDel",
                {id: $(this).attr("id")}, function (data) {
                if(data.status==200) {
                    lightyear.notify(data.data, "success", 100);
                    window.setTimeout("window.location.href = '/goods/shopGoodsType/goodsTypeList'",2000);
                }
            });
        });
    });

</script>
